from django.http import HttpResponse
from django.shortcuts import redirect, reverse

# Create your views here.


def index(request):
    username = request.GET.get('username')
    if username:
        return HttpResponse('前台首页')
    else:
        login_url = reverse('front:login')
        print('*' * 20)
        print(login_url)
        print('*' * 20)
        return redirect(login_url)


def login(request):
    return HttpResponse('前台登录')
